import axios from 'axios'
import { Storage } from '../../storage'

const getMyCourses = (type) => axios.get(`/api/work/in/myclass/${type}`, {
    headers: {
        "nothing-token": Storage.get("nothing-token")
    }
}).then(res => res.data)

const getWorkByCourseName = (courseName) => axios.get(`/api/work/in/course/${courseName}`)
    .then(res => res.data)


const submitWork = (form) => axios.post("/api/work/submit", form, {
    headers: {
        "nothing-token": Storage.get("nothing-token")
    }
}).then(res => res.data)

const workPostpone = (workId) => axios.post(`/api/work-put-postpone-record/put/${workId}`, null, {
    headers: {
        "nothing-token": Storage.get("nothing-token")
    }
}).then(res => res.data)


export {
    getMyCourses,
    getWorkByCourseName,
    submitWork,
    workPostpone
}